package com.care.inquiry.server.service.impl;

import java.util.List;

import com.care.inquiry.common.domain.Chat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.care.inquiry.server.mapper.ChatMapper;
import com.care.inquiry.server.service.IChatService;

/**
 * 聊天记录Service业务层处理
 *
 * @author care
 * @date 2024-03-26
 */
@Service
public class ChatServiceImpl implements IChatService
{
    @Autowired
    private ChatMapper chatMapper;

    /**
     * 查询聊天记录
     *
     * @param chatId 聊天记录主键
     * @return 聊天记录
     */
    @Override
    public Chat selectChatByChatId(Integer chatId)
    {
        return chatMapper.selectChatByChatId(chatId);
    }

    /**
     * 查询聊天记录列表
     *
     * @param chat 聊天记录
     * @return 聊天记录
     */
    @Override
    public List<Chat> selectChatList(Chat chat)
    {
        return chatMapper.selectChatList(chat);
    }

    /**
     * 新增聊天记录
     *
     * @param chat 聊天记录
     * @return 结果
     */
    @Override
    public int insertChat(Chat chat)
    {
        return chatMapper.insertChat(chat);
    }

    /**
     * 修改聊天记录
     *
     * @param chat 聊天记录
     * @return 结果
     */
    @Override
    public int updateChat(Chat chat)
    {
        return chatMapper.updateChat(chat);
    }

    /**
     * 批量删除聊天记录
     *
     * @param chatIds 需要删除的聊天记录主键
     * @return 结果
     */
    @Override
    public int deleteChatByChatIds(Integer[] chatIds)
    {
        return chatMapper.deleteChatByChatIds(chatIds);
    }

    /**
     * 删除聊天记录信息
     *
     * @param chatId 聊天记录主键
     * @return 结果
     */
    @Override
    public int deleteChatByChatId(Integer chatId)
    {
        return chatMapper.deleteChatByChatId(chatId);
    }
}
